# Maintainer: Luca Weiss <luca@z3ntu.xyz>
# Contributor: Brandon Boese <brandonboese@protonmail.com>
pkgname=biometryd
pkgver=0.3.1
pkgrel=0
pkgdesc="Mediates and multiplexes access to biometric devices"
url="https://gitlab.com/ubports/development/core/biometryd"
arch="all"
license="GPL-3.0-only"
depends="qt5-qtbase-sqlite"
makedepends="
	abseil-cpp-dev
	cmake
	cmake-extras
	dbus-cpp-dev
	dconf-dev
	elfutils-dev
	gnome-keyring
	gtest-dev
	libapparmor-dev
	libphonenumber-dev
	libqtdbustest
	lomiri-api-dev
	process-cpp-dev
	qt5-qtbase-dev
	qt5-qtdeclarative-dev
	samurai
	telepathy-mission-control-dev
	telepathy-qt-dev
	"
subpackages="$pkgname-dev"
source="https://gitlab.com/ubports/development/core/biometryd/-/archive/$pkgver/biometryd-$pkgver.tar.gz
	0001-Add-missing-headers-for-gcc-13.patch
	0004-disable_flaky_test.patch
	0005-add-missing-types-header.patch
	0006-direct-path-to-qmlplugindump.patch
	0001-Use-CMAKE_INSTALL_FULL_-for-installing.patch
	"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=ON \
		-DCMAKE_BUILD_TYPE=None \
		-DUSE_SYSTEMD=OFF
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure -E "test_(daemon|dbus_(codec|stub_skeleton))"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
357b9507596b080f14ed327a346eb45f3389de4c5699b0bff399feced1cf1d1bb489c5e3f27e8aa816c541d6ffc8152136e3cdf2928074469d6052c9c7eaca2b  biometryd-0.3.1.tar.gz
89cb2cd23bafbf7bf6be13378ba98f3c15748b72d0938523546a853948bcf9af9c9405231810bf96be750f0cfdf0e524e2a8468f6bf707faefef3560b16be81c  0001-Add-missing-headers-for-gcc-13.patch
4e0d8622df89742602ac43d5519c8d818da9e350b208b2468dce6b4a3764c6002f6ae67657c2b535f531c4f77374bee93f9e7be4b1cf3c3c1ef5f45d8abb8749  0004-disable_flaky_test.patch
8b702ef0e2a3e5f2b98c6e63661de0996d28dc3c8d09510802eae27ce1f453a5048b5ad987151821ba72c4a3bd2ebeaad3905c641f72e7528b63fb7148a0a3ef  0005-add-missing-types-header.patch
09960fd3fef3c8671c394c4d60b29f65a2b0f71cb002e007445154bcce1a932f29f383d0c272fa10883c8099df9dbb675517d393376ff443a3f1fd5ad640c818  0006-direct-path-to-qmlplugindump.patch
a8b429c7fe8cb8655823e7836fc79af839dca6bee3e0c8122bbe00bbf1dfb11afc9a50c4a761f1fce503f8a5951e2d156a805e2419b94a345ab2e985fe9c3eed  0001-Use-CMAKE_INSTALL_FULL_-for-installing.patch
"
